<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('wx_minigame_jumpgame_config', function (Blueprint $table) {
            $table->engine  = 'InnoDB';
            $table->comment('小游戏跳游戏');

            $table->increments('id');
            $table->integer('create_time')->comment('创建时间')->unsigned()->default(0);
            $table->string('name', 64)->comment('描述')->default('');
            $table->string('appid', 32)->comment('小游戏appid')->default('');
            $table->string('country_list', 64)->comment('国家列表')->default('');
            $table->string('province_list', 500)->comment('省份列表')->default('');
            $table->string('city_list', 500)->comment('城市列表')->default('');
            $table->string('limit_country_list', 64)->comment('限制国家列表')->default('');
            $table->string('limit_province_list', 500)->comment('限制省份列表')->default('');
            $table->string('limit_city_list', 500)->comment('限制城市列表')->default('');
            $table->integer('start_time')->comment('开始时间')->unsigned()->default(0);
            $table->integer('end_time')->comment('结束时间')->unsigned()->default(0);
            $table->tinyInteger('status')->comment('1开启 0关闭')->unsigned()->default(0);
            $table->string('query', 64)->comment('路径参数')->default('');
            $table->string('test_openids', 200)->comment('测试openid列表 最多10个')->default('');
            $table->string('device_list', 32)->comment('判断用户设备类型')->default('');
            $table->integer('per')->comment('跳转概率万分比')->unsigned()->default(0);
            $table->string('scene_list', 500)->comment('场景值列表')->default('');
            $table->string('limit_scene_list', 500)->comment('限制场景值列表')->default('');

            $table->index('appid');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('wx_minigame_jumpgame_config');
    }
};
